<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateMatriculaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateMatriculaLabel_idMatricula}" for="idMatricula" />
                    <h:inputText id="idMatricula" value="#{matriculaController.selected.idMatricula}" title="#{bundle.CreateMatriculaTitle_idMatricula}" required="true" requiredMessage="#{bundle.CreateMatriculaRequiredMessage_idMatricula}"/>
                    <h:outputLabel value="#{bundle.CreateMatriculaLabel_dataInicio}" for="dataInicio" />
                    <h:inputText id="dataInicio" value="#{matriculaController.selected.dataInicio}" title="#{bundle.CreateMatriculaTitle_dataInicio}" required="true" requiredMessage="#{bundle.CreateMatriculaRequiredMessage_dataInicio}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateMatriculaLabel_dataFim}" for="dataFim" />
                    <h:inputText id="dataFim" value="#{matriculaController.selected.dataFim}" title="#{bundle.CreateMatriculaTitle_dataFim}" required="true" requiredMessage="#{bundle.CreateMatriculaRequiredMessage_dataFim}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateMatriculaLabel_situacao}" for="situacao" />
                    <h:selectOneMenu id="situacao" value="#{matriculaController.selected.situacao}" title="#{bundle.CreateMatriculaTitle_situacao}" required="true" requiredMessage="#{bundle.CreateMatriculaRequiredMessage_situacao}">
                        <f:selectItems value="#{situacaoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateMatriculaLabel_aluno}" for="aluno" />
                    <h:selectOneMenu id="aluno" value="#{matriculaController.selected.aluno}" title="#{bundle.CreateMatriculaTitle_aluno}" required="true" requiredMessage="#{bundle.CreateMatriculaRequiredMessage_aluno}">
                        <f:selectItems value="#{alunoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateMatriculaLabel_turma}" for="turma" />
                    <h:selectOneMenu id="turma" value="#{matriculaController.selected.turma}" title="#{bundle.CreateMatriculaTitle_turma}" required="true" requiredMessage="#{bundle.CreateMatriculaRequiredMessage_turma}">
                        <f:selectItems value="#{turmaController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateMatriculaLabel_contrato}" for="contrato" />
                    <h:selectOneMenu id="contrato" value="#{matriculaController.selected.contrato}" title="#{bundle.CreateMatriculaTitle_contrato}" required="true" requiredMessage="#{bundle.CreateMatriculaRequiredMessage_contrato}">
                        <f:selectItems value="#{contratoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{matriculaController.create}" value="#{bundle.CreateMatriculaSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{matriculaController.prepareList}" value="#{bundle.CreateMatriculaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateMatriculaIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
